<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
<link rel="shortcut icon" href="image/favicon.ico" type="image/x-icon" />
    <title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body class="skin-blue">
    <div class="">
      <!-- Content Wrapper. Contains page content -->
      <div class="">
        <!-- Content Header (Page header) -->
        <section class="content-header">
		<h1>
			<ol class="breadcrumb">
				
				<li>列表信息</li>
			</ol>
          </h1>

		  
        </section>

        <!-- Main content -->
        <section class="content">
                 <a href="<%=basePath%>admin/goaddgk" style="margin-right:0px;"><button   class="btn  btn-info btn-xs info" style="width:80px;">添加</button></a>
          <div class="row">
            <div class="col-xs-12">
			
              <div class="box">
				
                <div class="box-body">
                
                  <table id="example2" class="table table-bordered table-hover">
                    <thead>
                      <tr>
                        <th>类型</th>
						<th>操作</th>
					</tr>
                    </thead>
                    <tbody>					  
					 <c:forEach items="${gklist}" var="gk">
                      <tr>
						
						<td ><a href="<%=basePath%>admin/gkinfo?id=${gk.id}">${gk.type }</a></td> 
                        <td>
							<button   onclick="look(${gk.id})" class="btn  btn-info btn-xs info" style="width:50px;">查看</button>
							<button   onclick="pub(${gk.id})" class="btn  btn-info btn-xs info" style="width:50px;">发布</button>
							<button   onclick="del(${gk.id})" class="btn  btn-info btn-xs info" style="width:50px;">删除</button>
						</td>
                      </tr>
                     </c:forEach> 
                     
                    </tbody>
                  </table>
                 <!-- 翻页 --> 
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper --> 
	</div><!-- ./wrapper -->
	<script type="text/javascript">

		$("#js").addClass("active");
		$("#js").find("li:first").next().addClass("active");
		
        $("#example2").dataTable({
		 	"bPaginate": true, // 翻页功能
			"bLengthChange": false, // 改变每页显示数据数量
			"bFilter": false, // 过滤功能
			"bSort": false, // 排序功能
			"bInfo": true, // 页脚信息
			"oLanguage" : {
                "sLengthMenu" : "每页显示_MENU_条记录",
                "sZeroRecords" : "抱歉， 没有找到记录",
                "sInfo" : "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty" : "没有数据",
                "sInfoFiltered" : "(从 _MAX_ 条数据中检索)",
                "oPaginate" : {
                    "sFirst" : "首页",
                    "sPrevious" : "前一页",
                    "sNext" : "后一页",
                    "sLast" : "尾页"
                },
                "sZeroRecords" : "没有检索到数据",
                "sProcessing" : "正在加载中..."
            },
			"bAutoWidth": true, // 自动宽度
		});
		
	 function info(id) {
		location.href="<%=basePath%>admin/gkinfo?id="+id;
	 }
	  function del(id) {
	  	location.href= "<%=basePath%>admin/delgk?id="+id; 
	  }
	   function pub(id) {
	  	location.href= "<%=basePath%>admin/pubgk?id="+id; 
	  }
	   function look(id) {
	  	location.href= "<%=basePath%>admin/gkinfo?id="+id; 
	  }
	</script>
  </body>
</html>
